public class Threaddoemo1 {
    private static class MyRunnable implements Runnable {
        public volatile boolean isQuit = false;

        @Override
        public void run() {
            while (!isQuit) {
                System.out.println(Thread.currentThread().getName()
                        + "别管我，我忙着转账呢！");
                try {
                    Thread.sleep(1000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
            System.out.println(Thread.currentThread().getName()
                    + "险些误了大事");
        }
    }

    public static void main(String[] args) {
        MyThread thread =new MyThread();
        System.out.println(Thread.currentThread().getName()
                + ": 让李四开始转账。");
        thread.start();
        try {
            Thread.sleep(10 * 1000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }

    }
    }


